{% extends "common/email.html" %}
{% block content %}
    <!-- 写信 -->
    <div id="writeMailView" style="width: 100%; overflow: auto; height: 100%; padding: 5px;">
        <form class="layui-form" id="MAIN_DATA_FORM" style="padding: 5px; background: #ffffff;">
            <div class="layui-form-item">
                <label class="layui-form-label">收件人</label>
                <div class="layui-input-block">
                    <input type="text" id="fconsigneeid" name="fconsigneeid" value="{{ nul2em(reciveMail.fconsigneeid) }}"
                           style="display: none;">
                    <input type="text" id="fconsignee" name="fconsignee" value="{{ nul2em(reciveMail.fconsignee) }}"
                           class="layui-input" readonly="readonly"
                           required lay-verify="required" style="width: 90%; float: left;"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">主题</label>
                <div class="layui-input-block">
                    <input type="text" id="femailname" name="femailname" value="{{ nul2em(reciveMail.femailname) }}"
                           required lay-verify="required" readonly
                           autocomplete="off" class="layui-input" style="width: 90%;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">发件人</label>
                <div class="layui-input-block">
                    <input type="text" id="fsendpername" name="fsendpername" value="{{ nul2em(reciveMail.fsendpername) }}"
                           required lay-verify="required"
                           autocomplete="off" class="layui-input" style="width: 90%;" readonly="readonly">
                    <input type="text" id="fsendperid" name="fsendperid" value="{{ nul2em(reciveMail.fsendperid) }}"
                           style="display: none;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">正文</label>
                <div class="layui-input-block">
                    <div style="width: 90%; min-height: 300px; border: 1px solid #eee; padding: 5px;">{{ nul2em(reciveMail.ftext) }}</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">附件</label>
                <div class="layui-input-block">
                    <div id="write_fj" style="width:90%; min-height: 60px;">保存“草稿”后可上传附件~</div>
                </div>
            </div>
            <div style="display: none;">
                <button id="mainfsub" class="layui-btn" lay-submit
                        lay-filter="mainform">立即提交
                </button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        var rowid = "{{ id }}";
        const MainData = new tlv8.Data();
        MainData.setTable("oa_em_receiveemail");
        MainData.setFormId("MAIN_DATA_FORM");
        if (rowid && rowid !== "") {
            MainData.setRowId(rowid);
            new tlv8.fileComponent(J$("write_fj"), MainData, "ffjid", "/root/内部邮箱/附件", false, false);
        }

        function goback() {
            //window.location.href = "/oa/email/mainActivity";
            window.history.back();
        }
    </script>
{% endblock %}